package com.example.lib_db.db.room

import androidx.room.AutoMigration
import androidx.room.Database
import androidx.room.RoomDatabase
import com.bw.lib_db.entity.UserInfo
import com.example.lib_db.db.room.dao.UserInfoDao

import com.example.lib_db.db.room.migrations.UserInfoColumnNameMigration
import com.example.lib_db.db.room.migrations.UserInfoTableNameMigration

@Database(entities = [UserInfo::class],//代表有多少张表
    version = 2,//代表当前数据库版本号
    exportSchema = true,//是否支持数据库协议导出
//    autoMigrations = [
//        AutoMigration(from = 1, to = 2, spec = UserInfoTableNameMigration::class),
//        AutoMigration(from = 1, to = 2, spec = UserInfoColumnNameMigration::class),
//                     ],//数据库升级策略
    )
abstract class AppDataBase :RoomDatabase(){
    //定义获取操作Dao抽象方法
    abstract fun getUserInfoDao(): UserInfoDao
}